<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">
        <i class="el-icon-s-home"></i>
        首页
      </el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/limits/store/list' }">
        <i class="el-icon-monitor"></i>
        权限管理
      </el-breadcrumb-item>
      <!-- 当前 -->
      <el-breadcrumb-item>添加角色</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="content">
      <div style="padding:40px;">
        <el-form ref="form" :model="form" label-width="100px">
          <el-form-item label="角色名称:">
            <el-input size="small" placeholder="请输入角色名称" v-model="form.name" style="width: 200px;"></el-input>
          </el-form-item>
          <el-form-item label="权限设置:">
            <div class="radio">
              <el-radio v-model="form.radio" @input="change" label="首页">首页</el-radio>
              <el-radio v-model="form.radio" @input="change" label="商品管理">商品管理</el-radio>
              <el-radio v-model="form.radio" @input="change" label="订单管理">订单管理</el-radio>
              <el-radio v-model="form.radio" @input="change" label="财务管理">财务管理</el-radio>
              <el-radio v-model="form.radio" @input="change" label="优惠管理">优惠管理</el-radio>
              <el-radio v-model="form.radio" @input="change" label="会员管理">会员管理</el-radio>
              <el-radio v-model="form.radio" @input="change" label="活动管理">活动管理</el-radio>
              <el-radio v-model="form.radio" @input="change" label="积分商城">积分商城</el-radio>
              <el-radio v-model="form.radio" @input="change" label="权限管理">权限管理</el-radio>
              <el-radio v-model="form.radio" @input="change" label="评价管理">评价管理</el-radio>
            </div>
          </el-form-item>
        </el-form>
        <div class="btnDiv1">
          <el-button type="primary" @click="save" size="small">添加</el-button>
          <el-button size="small" @click="qx">取消</el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import {AddRoleBx} from '../../utils/api'
export default {
  data() {
    return {
      form: {
        name: '',
        radio: '1',
      }
    }
  },
  methods: {
    // 保存
    save(){
      AddRoleBx(this.form).then(res=>{
       if(res.status == 200){
        this.$router.push('/limits/role')
       }
      })
    },
    change() {
      
    },
    qx(){
      this.$router.push('/limits/role')
    }
  }
}
</script>
<style scoped>
.btnDiv1 {
  width: 200px;
  display: flex;
  justify-content: space-between;
  margin-left: 100px;
  margin-top: 80px;
}
.radio {
  width: 100px;
}
</style>